package cn.demo.um.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.core.constant.SqlOperator;
import com.mybatisflex.core.query.SqlOperators;
import cn.demo.common.mybatisFlex.MyInsertListener;
import cn.demo.common.mybatisFlex.MyUpdateListener;
import cn.demo.common.annotation.Excel;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonIgnore;
import cn.demo.common.core.domain.BaseEntity;
/**
 * 用户属性值对象 um_attr_data
 *
 * @author xtjun
 * @date 2024-06-03
 */
@Data
@Table(value = "um_attr_data",onInsert = MyInsertListener.class,onUpdate = MyUpdateListener.class)
public class UmAttrData {
    private static final long serialVersionUID = 1L;

    @Id
    @Schema(description = "id")
    private String id;

    @Excel(name = "用户id")
    @Schema(description = "用户id")
    private String userId;

    @Excel(name = "属性代码")
    @Schema(description = "属性代码")
    private String attrCode;

    @Excel(name = "属性值")
    @Schema(description = "属性值")
    private String attrValue;

    @Excel(name = "是否择偶标准", dictType = "sys_yes_no")
    @Schema(description = "是否择偶标准(字典:sys_yes_no)")
    private Integer isStandard;

    // 自定义字段的 SQL 操作符
    @JsonIgnore
    public static final SqlOperators operators = new SqlOperators() {{
        set(UmAttrData::getUserId, SqlOperator.EQUALS);
        set(UmAttrData::getAttrCode, SqlOperator.EQUALS);
    }};
}
